<!DOCTYPE html>
<html>
  <head>
      <!-- HTML5文档类型 -->
    <meta charset="utf-8">
    <!-- 移动端适配 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <!-- 让IE浏览器使用最新的引擎渲染页面 -->
    <mata http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Bootstrap核心css库 -->
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <title>列表</title>
  </head>
  <body>
    <div class="form-group">
        <h1>webhook列表页面</h1>
        <button class="btn btn-success" data-target="#myModal" data-toggle="modal">create new webhook</button>
        <div class="modal fade"  id="myModal" aria-labelledby="myModallabel" aria-hidden="true" tabindex="-1">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button class="close" type="button" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h5 class="modal-title" id="myModallabel">机器人配置</h5>
                    </div>
                    <form action="{{ url_for('view.pusher-add') }}" method="post" class="form-horizontal">
                        <div class="modal-body">
                            <div class="form-group">
                                <label class="control-label col-lg-2">群名称：</label>
                                <div class="col-lg-9">
                                <input type="text" value="" name="address_name" placeholder="username" class="form-control"></br>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-lg-2">webhook：</label>
                                <div class="col-lg-9">
                                    <input type="text" placeholder="webhook" value="" name="webhook" class="form-control"></br>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-lg-2">secret: </label>
                                <div class="col-lg-9">
                                    <input type="text" placeholder="secret" value="" name="secret" class="form-control"></br>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                        <button class="btn btn-default" type="button" data-dismiss="modal">close</button>
                            <button class="btn btn-primary" type="submit">create</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>


    <table class="table table-bordered table-striped table-hover ">
      <thead class="table-dark ">
        <tr class="table-danger">
            <th>群名称</th>
            <th>调用接口</th>
            <th>secret</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
      </thead>
      <tbody>
        {%for item in webList%}
        <tr>
          <td>{{item.adress_name}}</td>
          <td>【POST】{{item.url}}</td>
          <td>{{item.secret}}</td>
          <td>{{item.create_time}}</td>
          <td>
              <a href="" class="btn btn-primary">编辑</a>
              <a href="{{ url_for(endpoint='view.pusher-del', id=item.id) }}" class="btn btn-danger">删除</a>
          </td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  </body>
</html>
